package school.valon.persistence.pojo;

import java.io.Serializable;

import javax.persistence.*;

import java.util.List;


/**
 * The persistent class for the staff database table.
 * 
 */
@Entity
@Table(name="staff")
@PrimaryKeyJoinColumn(name="staff_id", referencedColumnName="user_id")
@DiscriminatorValue("2")
@NamedQueries({
@NamedQuery(name="Staff.findAll", query="SELECT s FROM Staff s"),
@NamedQuery(name="Staff.deleteById", query="DELETE FROM Staff WHERE staffId = :P1")
})
public class Staff extends User implements Serializable {

	private static final long serialVersionUID = -7565491628403339790L;

	@Column(name="staff_id", insertable=false, updatable=false)
	private Integer staffId;

	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name="address_id", referencedColumnName="address_id")
	private Address address;

	@Column(name="emergency_contact")
	private String emergencyContact;

	//bi-directional many-to-one association to SchoolPolicy
	@OneToMany(mappedBy="staff", fetch=FetchType.LAZY)
	private List<SchoolPolicy> schoolPolicies;

	//bi-directional many-to-one association to StaffAttendance
	@OneToMany(mappedBy="staff", fetch=FetchType.LAZY)
	private List<StaffAttendance> staffAttendances;

	//bi-directional many-to-one association to StudentClassRecordingComment
	@OneToMany(mappedBy="staff", fetch=FetchType.LAZY)
	private List<StudentClassRecordingComment> studentClassRecordingComments;

	//bi-directional many-to-one association to SurveyQuestion
	@OneToMany(mappedBy="staff", fetch=FetchType.LAZY)
	private List<SurveyQuestion> surveyQuestions;

	//bi-directional many-to-one association to ValidationRule
	@OneToMany(mappedBy="staff", fetch=FetchType.LAZY)
	private List<ValidationRules> validationRules;

	//bi-directional many-to-one association to CourseOffering
	@OneToMany(mappedBy="staff", fetch=FetchType.LAZY)
	private List<CourseOffering> courseOfferings;

	//bi-directional many-to-one association to UserType
	@ManyToMany(fetch=FetchType.LAZY)
	@JoinTable(
			name="rel_staff_function"
			, joinColumns={
				@JoinColumn(name="staff_id", referencedColumnName="staff_id")
				}
			, inverseJoinColumns={
				@JoinColumn(name="staff_function_id", referencedColumnName="staff_function_id")
				}
			)
	private List<StaffFunction> staffFunctions;

	public Integer getStaffId() {
		return staffId;
	}

	public void setStaffId(Integer staffId) {
		this.staffId = staffId;
	}

	public Address getAddress() {
		return this.address;
	}

	public void setAddress(Address address) {
		this.address = address;
	}

	public String getEmergencyContact() {
		return this.emergencyContact;
	}

	public void setEmergencyContact(String emergencyContact) {
		this.emergencyContact = emergencyContact;
	}

	public List<SchoolPolicy> getSchoolPolicies() {
		return this.schoolPolicies;
	}

	public void setSchoolPolicies(List<SchoolPolicy> schoolPolicies) {
		this.schoolPolicies = schoolPolicies;
	}

	public List<StaffAttendance> getStaffAttendances() {
		return this.staffAttendances;
	}

	public void setStaffAttendances(List<StaffAttendance> staffAttendances) {
		this.staffAttendances = staffAttendances;
	}

	public List<StudentClassRecordingComment> getStudentClassRecordingComments() {
		return this.studentClassRecordingComments;
	}

	public void setStudentClassRecordingComments(List<StudentClassRecordingComment> studentClassRecordingComments) {
		this.studentClassRecordingComments = studentClassRecordingComments;
	}

	public List<SurveyQuestion> getSurveyQuestions() {
		return this.surveyQuestions;
	}

	public void setSurveyQuestions(List<SurveyQuestion> surveyQuestions) {
		this.surveyQuestions = surveyQuestions;
	}

	public List<ValidationRules> getValidationRules() {
		return this.validationRules;
	}

	public void setValidationRules(List<ValidationRules> validationRules) {
		this.validationRules = validationRules;
	}

	public List<StaffFunction> getStaffFunctions() {
		return staffFunctions;
	}

	public void setStaffFunctions(List<StaffFunction> staffFunctions) {
		this.staffFunctions = staffFunctions;
	}

	public List<CourseOffering> getCourseOfferings() {
		return this.courseOfferings;
	}

	public void setCourseOfferings(List<CourseOffering> courseOfferings) {
		this.courseOfferings = courseOfferings;
	}

}